package com.ophiux.FeverManagement.infratructure.repository;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.ophiux.FeverManagement.domain.entity.RbTreatmentMedicine;
import com.ophiux.FeverManagement.domain.repository.ITreatmentMedicineRepository;
import com.ophiux.FeverManagement.infratructure.mapper.RbTreatmentMedicineMapper;
import com.ophiux.utils.exception.OphiuxDaoException;
import com.ophiux.utils.exception.OphiuxRepositoryException;

import lombok.extern.slf4j.Slf4j;

@Repository
@Slf4j
public class TreatmentMedicineRepository implements ITreatmentMedicineRepository{
	@Autowired
	RbTreatmentMedicineMapper treatmentMedicineMapper;

	@Override
	public String save(RbTreatmentMedicine model) throws OphiuxRepositoryException {
		
		return null;
	}

	@Override
	public void delete(Object uniqueId) throws OphiuxRepositoryException {
		
		
	}

	@Override
	public RbTreatmentMedicine selectOneByKey(Object uniqueId) throws OphiuxRepositoryException {
		try {
			//uniqueId==MEDICINE_ID
			RbTreatmentMedicine model = treatmentMedicineMapper.selectOneByKey(uniqueId.toString());
			return model;
		} catch (OphiuxDaoException e) {
			e.printStackTrace();
			log.info("数据库执行异常,异常信息", e);
			throw new OphiuxRepositoryException(e);
		}
	}

	@Override
	public RbTreatmentMedicine selectOne(Map map) throws OphiuxRepositoryException {
		
		return null;
	}

	@Override
	public List<RbTreatmentMedicine> selectAll(Map map) throws OphiuxRepositoryException {
		
		return null;
	}

}
